/*
mentrixmax.
Todos os direitos reservados
Nome do projeto : Teste
Nome do módulo  : DAO
Data de início  : 08/06/2013
Responsável(is) : Mateus Neto
Observações  : 
Contato : mentrixmax@gmail.com
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Menfram.Business.Interface;
using Menfram.Entity.Interface;
using MentrixmaxFormularios;
using Negocio;
using Entidades;
using ComunsTeste; 
using MentrixmaxFormularios.FormsAbstratos;
namespace IU.ManterCaixa
{
	/// <summary>
	///  classe de formulario referente a tabela: tbCaixa
	/// </summary>
	public partial class frmBuscaAvancadaCaixa:frmPesqInterAvncCaixa
	{
		/// <summary> 
		/// Constutor Padrão
		/// Autor: Gerador NAT
		/// </summary> 
		public frmBuscaAvancadaCaixa()
			{
				InitializeComponent();
				this.dbGridPrincipal.DataSource = getNegocio().findAll(); 
			}

		#region atributos 
		private System.Windows.Forms.TextBox txtData;
		private System.Windows.Forms.Label  lbData;

		private System.Windows.Forms.TextBox txtOperacao;
		private System.Windows.Forms.Label  lbOperacao;

		private System.Windows.Forms.TextBox txtValor;
		private System.Windows.Forms.Label  lbValor;

		private System.Windows.Forms.TextBox txtSequencialUsr;
		private System.Windows.Forms.Label  lbSequencialUsr;

		private System.Windows.Forms.TextBox txtSequencialVen;
		private System.Windows.Forms.Label  lbSequencialVen;

		private System.Windows.Forms.TextBox txtTipo;
		private System.Windows.Forms.Label  lbTipo;

		#endregion 

		/// <summary> 
		/// Método que inicializa o form no VS2005
		/// Autor: Gerador NAT
		/// </summary> 
		private void InitializeComponent(){
		 this.Text = "Consultar Caixa "; 
			lbData= new System.Windows.Forms.Label();
			lbData.AutoSize = true;
			lbData.Location = new System.Drawing.Point(21,14);
			lbData.Name ="lbData";
			lbData.Text = "*Data";
			gbPesquisa.Controls.Add(lbData);
			txtData= new System.Windows.Forms.TextBox();
			txtData.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
			txtData.KeyUp += new System.Windows.Forms.KeyEventHandler(this.OnTxtCodigoKeyUp);
			txtData.Location = new System.Drawing.Point(21,34);
			txtData.MaxLength =8;
			txtData.Name ="txtData";
			txtData.TabIndex = 0;
			gbPesquisa.Controls.Add(txtData);
			lbOperacao= new System.Windows.Forms.Label();
			lbOperacao.AutoSize = true;
			lbOperacao.Location = new System.Drawing.Point(171,14);
			lbOperacao.Name ="lbOperacao";
			lbOperacao.Text = "*Operacao";
			gbPesquisa.Controls.Add(lbOperacao);
			txtOperacao= new System.Windows.Forms.TextBox();
			txtOperacao.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
			txtOperacao.KeyUp += new System.Windows.Forms.KeyEventHandler(this.OnTxtCodigoKeyUp);
			txtOperacao.Location = new System.Drawing.Point(171,34);
			txtOperacao.MaxLength =4;
			txtOperacao.Name ="txtOperacao";
			txtOperacao.TabIndex = 1;
			gbPesquisa.Controls.Add(txtOperacao);
			lbValor= new System.Windows.Forms.Label();
			lbValor.AutoSize = true;
			lbValor.Location = new System.Drawing.Point(321,14);
			lbValor.Name ="lbValor";
			lbValor.Text = "*Valor";
			gbPesquisa.Controls.Add(lbValor);
			txtValor= new System.Windows.Forms.TextBox();
			txtValor.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
			txtValor.KeyUp += new System.Windows.Forms.KeyEventHandler(this.OnTxtCodigoKeyUp);
			txtValor.Location = new System.Drawing.Point(321,34);
			txtValor.MaxLength =9;
			txtValor.Name ="txtValor";
			txtValor.TabIndex = 2;
			gbPesquisa.Controls.Add(txtValor);
			lbSequencialUsr= new System.Windows.Forms.Label();
			lbSequencialUsr.AutoSize = true;
			lbSequencialUsr.Location = new System.Drawing.Point(21,59);
			lbSequencialUsr.Name ="lbSequencialUsr";
			lbSequencialUsr.Text = "*SequencialUsr";
			gbPesquisa.Controls.Add(lbSequencialUsr);
			txtSequencialUsr= new System.Windows.Forms.TextBox();
			txtSequencialUsr.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
			txtSequencialUsr.KeyUp += new System.Windows.Forms.KeyEventHandler(this.OnTxtCodigoKeyUp);
			txtSequencialUsr.Location = new System.Drawing.Point(21,79);
			txtSequencialUsr.MaxLength =4;
			txtSequencialUsr.Name ="txtSequencialUsr";
			txtSequencialUsr.TabIndex = 3;
			gbPesquisa.Controls.Add(txtSequencialUsr);
			lbSequencialVen= new System.Windows.Forms.Label();
			lbSequencialVen.AutoSize = true;
			lbSequencialVen.Location = new System.Drawing.Point(171,59);
			lbSequencialVen.Name ="lbSequencialVen";
			lbSequencialVen.Text = "*SequencialVen";
			gbPesquisa.Controls.Add(lbSequencialVen);
			txtSequencialVen= new System.Windows.Forms.TextBox();
			txtSequencialVen.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
			txtSequencialVen.KeyUp += new System.Windows.Forms.KeyEventHandler(this.OnTxtCodigoKeyUp);
			txtSequencialVen.Location = new System.Drawing.Point(171,79);
			txtSequencialVen.MaxLength =4;
			txtSequencialVen.Name ="txtSequencialVen";
			txtSequencialVen.TabIndex = 4;
			gbPesquisa.Controls.Add(txtSequencialVen);
			lbTipo= new System.Windows.Forms.Label();
			lbTipo.AutoSize = true;
			lbTipo.Location = new System.Drawing.Point(321,59);
			lbTipo.Name ="lbTipo";
			lbTipo.Text = "*Tipo";
			gbPesquisa.Controls.Add(lbTipo);
			txtTipo= new System.Windows.Forms.TextBox();
			txtTipo.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
			txtTipo.KeyUp += new System.Windows.Forms.KeyEventHandler(this.OnTxtCodigoKeyUp);
			txtTipo.Location = new System.Drawing.Point(321,79);
			txtTipo.MaxLength =4;
			txtTipo.Name ="txtTipo";
			txtTipo.TabIndex = 5;
			gbPesquisa.Controls.Add(txtTipo);

		}

		/// <summary>
		/// Metodo que retorna a classe de negocio do uc Caixa
		/// Autor: Gerador NAT
		/// </summary>
		/// <returns></returns> 
		public override IBusiness<CaixaEntidade> getNegocio() 
		{ 
			return CaixaNegocio.getInstance();
		}

		public override FrmPaiInterface obtemFormularioPai() 
		{ 
		 FrmPaiInterface frm = new  frmCaixa();
			return frm;
		}

		/// <summary> 
		///  Método que associa o envento aos campos, e tambem realiza as buscas
		/// Autor: Gerador NAT
		/// </summary> 
		/// <param name="sender">object</param> 
		/// <param name="e">System.Windows.Forms.KeyEventArgs</param> 
		/// 
		private void OnTxtCodigoKeyUp(object sender, System.Windows.Forms.KeyEventArgs e) 
		{
			RealizaBusca(sender, new EventArgs());
		}

		/// <summary> 
		/// Metodo que retorna o filtro de consulta.
		/// Autor: Gerador NAT
		/// </summary>
		/// <returns>IEntidade</returns>
		protected override IEntity getEntidade()
			{
			  CaixaEntidade obj =  new CaixaEntidade();
				   if (txtData.Text != String.Empty)
					  {
						  obj.Data = Convert.ToDateTime(txtData.Text);
					  }
				   if (txtOperacao.Text != String.Empty)
					  {
						  obj.Operacao = Convert.ToInt32(txtOperacao.Text);
					  }
				   if (txtValor.Text != String.Empty)
					  {
						  obj.Valor = Convert.ToDecimal(txtValor.Text);
					  }
				   if (txtSequencialUsr.Text != String.Empty)
					  {
						  obj.SequencialUsr = Convert.ToInt32(txtSequencialUsr.Text);
					  }
				   if (txtSequencialVen.Text != String.Empty)
					  {
						  obj.SequencialVen = Convert.ToInt32(txtSequencialVen.Text);
					  }
				   if (txtTipo.Text != String.Empty)
					  {
						  obj.Tipo = Convert.ToInt32(txtTipo.Text);
					  }
			 return obj;
			}


 public override IList<DadosGrid> getListaLabelColuna() 
{
List<DadosGrid> list = new List<DadosGrid>(); 
DadosGrid DataDados = new DadosGrid() { LabelColuna="Data", NomeColuna="Data",Visible=true,Size=100}; 
list.Add(DataDados);
DadosGrid OperacaoDados = new DadosGrid() { LabelColuna="Operacao", NomeColuna="Operacao",Visible=true,Size=100}; 
list.Add(OperacaoDados);
DadosGrid ValorDados = new DadosGrid() { LabelColuna="Valor", NomeColuna="Valor",Visible=true,Size=100}; 
list.Add(ValorDados);
DadosGrid SequencialUsrDados = new DadosGrid() { LabelColuna="SequencialUsr", NomeColuna="SequencialUsr",Visible=true,Size=100}; 
list.Add(SequencialUsrDados);
DadosGrid SequencialVenDados = new DadosGrid() { LabelColuna="SequencialVen", NomeColuna="SequencialVen",Visible=true,Size=100}; 
list.Add(SequencialVenDados);
DadosGrid TipoDados = new DadosGrid() { LabelColuna="Tipo", NomeColuna="Tipo",Visible=true,Size=100}; 
list.Add(TipoDados);
return list;
 } 

}
 public  class frmPesqInterAvncCaixa : FrPesquisaPai<CaixaEntidade>
{
public frmPesqInterAvncCaixa()
{
}
 }
}
